import request from '@/utils/request'

/* 全国区划*/

/* 全部加载 */
export function getHisRegionAll(data) {
  return request({
    url: `/basic/hisRegionAll/tree`,
    method: 'get',
    params: data
  })
}

export function addHisRegionAll(data) {
  return request({
    url: `/basic/hisRegionAll`,
    method: 'post',
    params: data
  })
}

export function updateHisRegionAll(data) {
  return request({
    url: `/basic/hisRegionAll`,
    method: 'put',
    params: data
  })
}

export function deleteRegionAll(id) {
  return request({
    url: `/basic/hisRegionAll/${id}`,
    method: 'delete'
  })
}

export function initRegionAll(id) {
  return request({
    url: `/basic/hisRegionAll/init/${id}`,
    method: 'delete'
  })
}

export function getHisRegionAllMessage(code) {
  return request({
    url: `/basic/hisRegionAll/msg/${code}`,
    method: 'get'
  })
}

/* 全国区划懒加载 */
export function lazyRegionAll(data) {
  return request({
    url: `/basic/hisRegionAll/lazy`,
    method: 'get',
    params: data
  })
}

export function lazyNodeRegionAll(code) {
  return request({
    url: `/basic/hisRegionAll/lazy/${code}`,
    method: 'get'
  })
}

export function isCounty(code) {
  return request({
    url: `/basic/hisRegionAll/${code}`,
    method: 'get'
  })
}

